#ifndef FORMPZLR_H
#define FORMPZLR_H

#include <QWidget>
#include <QTableWidget>
#include <QKeyEvent>
#include <QTreeWidgetItem>
#include <QMenu>
#include <QAction>
#include <QtGui>
#include <QTableWidgetItem>
#include <jcode.h>
#include <QHttpMultiPart>
#include <qnetworkreply.h>
#include <qfile.h>


namespace Ui {
class FormPZLR;
}

class FormPZLR : public QWidget
{
    Q_OBJECT
public:
    explicit FormPZLR(QWidget *parent = nullptr);
    void keyPressEvent(QKeyEvent *keyevent);
    ~FormPZLR();


    QNetworkReply *reply; //文件上传
    QNetworkReply *Httpreply; //http请求
private slots:
    void Start(); //初始化
    void RefTree(); //刷新科目代码
    void chkXM();  //检查项目
    bool RefJD(); //刷新借贷信息
    void GetHTTP(QString Url); //发送http请求
    void replyFinish(QNetworkReply*); //用于处理响应返回的数据
    bool LoadPZ(QString ND,int PZH); //读取凭证信息
    void LoadFJ(QString ND,int PZBH); //读取附件信息
    bool DownLoadFile(QString FileUrl,QString LocalFile); //下载远程文件
    void FileUPload(QString url,QString FileName,const char * SN); //文件上传
    void uploadFinished();  //文件上传完成标记
    void receiveDZFP(QString DATA); //接受电子发票信息
    void receiveCAM(QString data); //接受文件拍照信息
    void MenuSlot(QAction *action); //右键菜单代码
    void showMenuPos(QPoint); //右键菜单位置

    void on_txtInput_textChanged(const QString &arg1);
    void on_tablePZ_itemClicked(QTableWidgetItem *item);
    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
    void on_treeWidgetXM_itemClicked(QTreeWidgetItem *item, int column);
    void on_btnCloseXM_clicked();
    void on_btnNEW_clicked();
    void on_btnSave_clicked();
    void on_cmbHB_currentTextChanged(const QString &arg1);
    void on_txtWB_textChanged(const QString &arg1);
    void on_btnLoad_clicked();
    void on_btnPrint_clicked();
    void on_txtHL_textChanged(const QString &arg1);
    void on_btnPaste_clicked();
    void on_btnCopy_clicked();
    void on_btnPZFJ_clicked();
    void on_btnInvoice_clicked();
    void on_treeWidgetFJ_itemDoubleClicked(QTreeWidgetItem *item, int column);
    void on_btnCamera_clicked();
    void on_btnFile_clicked();
    void on_btnDelFile_clicked();

    void on_btnFHRZ_clicked();

protected:
     virtual void focusInEvent(QFocusEvent *e);
     virtual void focusOutEvent(QFocusEvent *e);

private:
    Ui::FormPZLR *ui;

    QString old_text; //保存原来的数据  遇到不符合要求的数据就写会原来的数据
    QString KMDM;
    QString KMMC;
    QString XMBH;
    QString BMBH;
    QString BMMC;
    QString ZYXX;
    QString HSHB;
    int itemR=0;  //保存QTableWidget的行号
    int itemC=0;  //保存QTableWidget的列号
    int lineHeight=68;

    QMenu *menu;
    QAction  *addRow, *reRow;
//protected:

//      virtual


};

#endif // FORMPZLR_H
